<!DOCTYPE html>
<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Unity WebGL Player | NewJimu</title>
    <link rel="shortcut icon" href="TemplateData/favicon.ico">
    <link rel="stylesheet" href="TemplateData/style.css">
    <script src="TemplateData/UnityProgress.js"></script>
    <script src="Build/UnityLoader.js"></script>
    <script>
      var gameInstance = UnityLoader.instantiate("gameContainer", "Build/test.json", {onProgress: UnityProgress});

      function Reset() {
      var canvas = document.getElementById("#canvas");
      canvas.height = document.documentElement.clientHeight;
      canvas.width = document.documentElement.clientWidth;
    }
    function ShowObj() //承接Unity
    {
      var PC = IsPC();
      gameInstance.SendMessage("ShowMessage", "GetInformation", PC + '_' + 1); //参数依次是:场景中挂载脚本的物体,脚本中与html交互的方法,需要传入的参数.
    }
    function IsPC() // 判断目前运行平台的方法
    {
      var userAgentInfo = navigator.userAgent;
      var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
      var flag = true;
      for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
          flag = false;
          break;
        }
      }
      return flag;
    }

    </script>
  </head>
  <body>
    <div class="webgl-content">
      <div id="gameContainer" style="width: 1440px; height: 900px"></div>
      <div class="footer">
        <div class="webgl-logo"></div>
        <div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div>
        <div class="title">NewJimu</div>
      </div>
    </div>
  </body>
</html>
